<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>
<%@page import="dyyx.dto.*"%>
<%@page import="dyyx.util.*"%>
<%@page import="java.util.*"%>
<%@page import="org.apache.kafka.clients.admin.*"%>
<%@page import="org.apache.kafka.common.*"%>
<%

WebResult webResult = new WebResult();
KafkaViewWebUtil.getTopicDesc(request, webResult);
TopicDescription topicDescription = webResult.topicDescription;
List<TopicPartitionInfo> partitions = null;
if(topicDescription!=null){
	partitions = topicDescription.partitions();
}

if(partitions==null){
	partitions = new ArrayList<TopicPartitionInfo>();
}

%>

<%@include file="/comm.jsp"%>

<hr>
<%=new Date() %>  <br>
<%=webResult.msg %>
<hr>
topic: <%=webResult.topic %> <br>

<%if(topicDescription==null){ return;} %>

internal : <%=topicDescription.isInternal() %>

<hr>

<table>

<tr class='title'>

<td>partition</td>
<td>leader</td>
<td>replicas</td>
<td>isr</td>


</tr>

<%for(TopicPartitionInfo item:partitions){ %>


<tr>

<td><%=item.partition() %></td>
<td><%=item.leader() %></td>
<td><%=KafkaUtil.toNodeString(item.replicas(),"<br>")%></td>
<td><%=KafkaUtil.toNodeString(item.isr(),"<br>")%></td>
</tr>

<%} %>


</table>



